import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: () => import('../views/MainVue.vue'),
    children:[{
      path: 'welcome',
      component:() => import('../views/main/welcome.vue'),
    },{
      path: 'about',
      component:() => import('../views/main/about.vue')
    },{
      path: 'base/',
      children:[{
        path: 'station',
        component:() => import('../views/main/base/station.vue')
      },{
        path: 'train',
        component:() => import('../views/main/base/train.vue')
      },{
        path: 'trainStation',
        component:() => import('../views/main/base/trainStation.vue')
      },{
        path: 'trainCarriage',
        component:() => import('../views/main/base/trainCarriage.vue')
      },{
        path: 'trainSeat',
        component:() => import('../views/main/base/trainSeat.vue')
      }]
    },{
      path: 'business/',
      children:[{
        path: 'dailyTrain',
        component:() => import('../views/main/business/dailyTrain.vue')
      },{
        path: 'dailyTrainStation',
        component:() => import('../views/main/business/dailyTrainStation.vue')
      },{
        path: 'dailyTrainCarriage',
        component:() => import('../views/main/business/dailyTrainCarriage.vue')
      },{
        path: 'dailyTrainSeat',
        component:() => import('../views/main/business/dailyTrainSeat.vue')
      },{
        path: 'dailyTrainTicket',
        component:() => import('../views/main/business/dailyTrainTicket.vue')
      },{
        path: 'confirmOrder',
        component:() => import('../views/main/business/confirmOrder.vue')
      }]
    },{
      path: 'batch/',
      children: [{
        path: 'job',
        component:() => import('../views/main/batch/job.vue')
      }]
    },{
      path: 'member/',
      children: [{
        path: 'ticket',
        component:() => import('../views/main/member/ticket.vue')
      }]
    }]
  }, {
    path: '',  //访问根域名 也就是/的时候 会重定向到welcome
    redirect: '/welcome'
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
